#include <bits/stdc++.h>

#define fi first
#define se second
#define eb emplace_back
#define ep emplace
#define rep(i, x, y) for(int i = (x); i <= (y); i++)
#define per(i, x, y) for(int i = (x); i >= (y); i--)

using namespace std;

using ll = long long;
using pii = pair < int, int >;
using vec = vector < int >;
using veg = vector < pii >;

const int N = 5010;

template < typename T > void chkmin(T &x, const T &y) { x = x < y ? x : y; }

char s[N], t[N];
bool f[N][N];
int n;
int nxt[N];

void solve() {
	scanf("%s", s + 1); n = strlen(s + 1);
	rep(i, 1, n) rep(j, 1, n) f[i][j] = 0;
	per(i, n, 1) {
		rep(j, i, n) {
			t[j - i + 1] = s[j];
		}
		nxt[1] = 0; int k = 0;
		rep(j, 2, n - i + 1)  {
			while(k && t[k + 1] != t[j]) k = nxt[k];
			if(t[k + 1] == t[j]) k++;
			nxt[j] = k;
		}
		k = 0;
		rep(j, 2, n - i + 1) {
			while(k && t[k + 1] != t[j]) k = nxt[k];
			if(t[k + 1] == t[j]) k++;
			while(k * 2 > j) k = nxt[k];
			if(k * 2 ==  j) f[i][j + i - 1] = 1;
			else f[i][j + i - 1] = f[i + k][j + i - 1 - k];
			//cerr << i << " " << j + i - 1 << " " << k << " " << f[i][j + i - 1] << endl;
		} 
	} int ans = 0; rep(i, 1, n) rep(j, i, n) ans += f[i][j];
	printf("%d\n", ans);
}
int main() {
#ifdef YJR_2333_TEST
	freopen("1.in", "w", stdout);
#endif
	//ios :: sync_with_stdio(false), cin.tie(0), cout.tie(0);
	printf("%d\n", 15000);
	mt19937 rnd(time(NULL));
	rep(i, 1, 15000) {
		int t = rnd() % 10;
		if(t == 0) printf("x ");
		else printf("%d ", t);
	} puts("");
	puts("9");
	rep(i, 1, 9) printf("%d %d\n", i, rnd() % 1000000000);
}
